package org.iks.common.pojo.message;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import lombok.Getter;
import lombok.Setter;
import lombok.ToString;
import org.iks.common.aop.serializer.ChatMessageTypeSerializer;
import org.iks.common.constant.Constant;
import org.iks.common.enums.ChatMessageType;
import org.iks.common.pojo.store.SecretKeyVo;
import org.iks.common.pojo.user.UserInfoVo;
import org.springframework.lang.NonNull;

import java.util.Date;

/**
 * @author kzou
 * @date 2024/1/2 20:49
 * @description: 聊天信息
 */
@Getter
@Setter
@ToString
public class ChatMessage  {

    /**
     * 消息ID
     */
    private Integer id;

    /**
     * 会话ID
     */
    private Integer sessionId;

    /**
     * 消息类容
     */
    private String content;

    /**
     * 发送者账号
     */
    private String senderAccount;
    private UserInfoVo userInfoVo;

    @JsonFormat(pattern = Constant.DATE_TIME_FORMAT)
    private Date sendTime;

    /**
     * 消息类型
     */
    @JsonSerialize(using = ChatMessageTypeSerializer.class)
    private ChatMessageType chatMessageType;

    /**
     * 会话密钥版本
     */
    private Integer secretVersion;

    @NonNull
    private SecretKeyVo secretKeyVo;


}
